package com.sbc.ticket.controller;

import com.sbc.convention.result.Result;
import com.sbc.log.annotation.ILog;
import com.sbc.ticket.pojo.vo.RegionRespVo;
import com.sbc.ticket.pojo.vo.StationRespVo;
import com.sbc.ticket.service.IRegionStationService;
import com.sbc.web.Results;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description: 地区以及车站查询控制层
 * @author: songbaicheng
 * @create: 2024-05-16 14:43
 **/
@ILog
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/ticket")
public class RegionStationController {

    private final IRegionStationService regionStationService;

    /**
     * 查询地区集合信息
     */
    @GetMapping("/region/query/all")
    public Result<List<RegionRespVo>> listAllRegion() {
        return Results.success(regionStationService.listAllRegion());
    }

    /**
     * 查询车站站点集合信息
     */
    @GetMapping("/station/query/all")
    public Result<List<StationRespVo>> listAllStation() {
        return Results.success(regionStationService.listAllStation());
    }
}
